package org.loofer.uiframework.common;

import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;

public class ParcelableBinder implements Parcelable {
    public static final Creator<ParcelableBinder> CREATOR = new Creator<ParcelableBinder>() {
        public ParcelableBinder createFromParcel(Parcel source) {
            return new ParcelableBinder(source);
        }

        public ParcelableBinder[] newArray(int size) {
            return new ParcelableBinder[size];
        }
    };
    private final IBinder mBinder;

    public ParcelableBinder(IBinder binder) {
        this.mBinder = binder;
    }

    private ParcelableBinder(Parcel parcel) {
        this.mBinder = parcel.readStrongBinder();
    }

    public IBinder getBinder() {
        return this.mBinder;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeStrongBinder(this.mBinder);
    }
}
